<?php
namespace Components\Account\User\Info;

class Filter extends \Phalcon\Filter implements \Phalcon\FilterInterface {  
  public function checkAddress_detail($value) {
    return $this -> sanitize($value, ['string','trim']);
  }

  public function checkAddress_code($value) {
    if(isset($value[2])) {
      return $value[2];
    } else if(isset($value[1])) {
      return $value[1];
    } else if(isset($value[0])) {
      return $value[0];
    }
    return 0;
  }

  public function checkSex($value) {
    return $this -> sanitize($value, 'int');
  }

  public function checkIdentity_card($value) {
    return $this -> sanitize($value, ['string','trim']);
  }

  public function checkBank_name($value) {
    return $this -> sanitize($value, ['string','trim']);
  }

  public function checkBank_account($value) {
    return $this -> sanitize($value, ['string','trim']);
  }

  public function checkBank_account_name($value) {
    return $this -> sanitize($value, ['string','trim']);
  }

  public function checkBank_deposit($value) {
    return $this -> sanitize($value, ['string','trim']);
  }
}
